in...
dist = (((dist * 180.0 * 60.0) / M_PI) * 1.1516);
if ( waypointp->extra_data ) {
- ed = waypointp->extra_data;
+ ed = (extra_data *) waypointp->extra_data;
}
else {
- ed = xcalloc(1, sizeof(*ed));
+ ed = (extra_data *) xcalloc(1, sizeof(*ed));
ed->distance = BADVAL;
}
if ( ed->distance > dist ) {
QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
waypoint *wp = (waypoint *) elem;
- ed = wp->extra_data;
+ ed = (extra_data *) wp->extra_data;
wp->extra_data = NULL;
if ( ed ) {
if ((ed->distance >= pos_dist) == (exclopt == NULL)) {
void route_add_wpt(route_head *rte, waypoint *wpt);
void route_del_wpt(route_head *rte, waypoint *wpt);
void route_add_head(route_head *rte);
+void route_reverse(const route_head *rte_hd);
void track_add_head(route_head *rte);
void route_disp_all(route_hdr, route_trl, waypt_cb);
void track_disp_all(route_hdr, route_trl, waypt_cb);
char *xstrdup(const char *s);
char *xstrndup(const char *s, size_t n);
char *xstrndupt(const char *s, size_t n);
-char *xstrappend(char *src, const char *new);
+char *xstrappend(char *src, const char *addon);
#define xxcalloc(nmemb, size, file, line) xcalloc(nmemb, size)
#define xxmalloc(size, file, line) xmalloc(size)
#define xxrealloc(p, s, file, line) xrealloc(p,s)
#define xxfree(mem, file, line) xfree(mem)
#define xxstrdup(s, file, line) xstrdup(s)
-#define xxstrappend(src, new, file, line) xstrappend(src, new)
+#define xxstrappend(src, addon, file, line) xstrappend(src, addon)
#else /* DEBUG_MEM */
void *XCALLOC(size_t nmemb, size_t size, DEBUG_PARAMS );
void *XMALLOC(size_t size, DEBUG_PARAMS );
char *XSTRDUP(const char *s, DEBUG_PARAMS );
char *XSTRNDUP(const char *src, size_t size, DEBUG_PARAMS );
char *XSTRNDUPT(const char *src, size_t size, DEBUG_PARAMS );
-char *XSTRAPPEND(char *src, const char *new, DEBUG_PARAMS );
+char *XSTRAPPEND(char *src, const char *addon, DEBUG_PARAMS );
void debug_mem_open();
void debug_mem_output( char *format, ... );
void debug_mem_close();
#define xstrdup(s) XSTRDUP(s, __FILE__, __LINE__)
#define xstrndup(s, z) XSTRNDUP(s, z, __FILE__, __LINE__)
#define xstrndupt(s, z) XSTRNDUPT(s, z, __FILE__, __LINE__)
-#define xstrappend(src,new) XSTRAPPEND(src, new, __FILE__, __LINE__)
+#define xstrappend(src,addon) XSTRAPPEND(src, addon, __FILE__, __LINE__)
#define xxcalloc XCALLOC
#define xxmalloc XMALLOC
#define xxrealloc XREALLOC
queue *elem, *tmp;
extern queue waypt_head;
- htable = xmalloc(ct * sizeof(*htable));
+ htable = (wpt_ptr *) xmalloc(ct * sizeof(*htable));
bh = htable;
i = 0;
/*
Access GPX data files.
- Copyright (C) 2002 Robert Lipe, robertlipe@usa.net
+ Copyright (C) 2002, 2003, 2004 Robert Lipe, robertlipe@usa.net
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
if (lat == 0 && lon == 0) /* skip records with no GPS data */
continue;
- wpt_tmp = xcalloc(sizeof(*wpt_tmp), 1);
+ wpt_tmp = (waypoint *) xcalloc(sizeof(*wpt_tmp), 1);
if (stealth) {
if (!snmac)
unsigned long last_crc;
char ssid[32 + 5 + 1];
- htable = xmalloc(ct * sizeof *htable);
+ htable = (htable_t *) xmalloc(ct * sizeof *htable);
bh = htable;
i = 0;
waypointp = (waypoint *)elem;
if ( waypointp->extra_data ) {
- ed = waypointp->extra_data;
+ ed = (extra_data *) waypointp->extra_data;
}
else {
- ed = xcalloc(1, sizeof(*ed));
+ ed = (extra_data *) xcalloc(1, sizeof(*ed));
ed->state = OUTSIDE;
ed->override = 0;
- waypointp->extra_data = ed;
+ waypointp->extra_data = (extra_data *) ed;
}
if ( lat2 == waypointp->latitude &&
lon2 == waypointp->longitude ) {
QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
waypoint *wp = (waypoint *) elem;
- ed = wp->extra_data;
+ ed = (extra_data *) wp->extra_data;
wp->extra_data = NULL;
if ( ed ) {
if ( ed->override ) ed->state = INSIDE;
{
const waypoint *x1 = *(waypoint **)a;
const waypoint *x2 = *(waypoint **)b;
- extra_data *x1e = x1->extra_data;
- extra_data *x2e = x2->extra_data;
+ extra_data *x1e = (extra_data *) x1->extra_data;
+ extra_data *x2e = (extra_data *) x2->extra_data;
if (x1e->distance > x2e->distance)
return 1;
wc = waypt_count();
- comp = xcalloc(wc, sizeof(*comp));
+ comp = (waypoint **) xcalloc(wc, sizeof(*comp));
i = 0;
continue;
}
- ed = xcalloc(1, sizeof(*ed));
+ ed = (extra_data *) xcalloc(1, sizeof(*ed));
ed->distance = dist;
waypointp->extra_data = ed;
}
wc = waypt_count();
QUEUE_INIT(&temp_head);
- comp = xcalloc(wc, sizeof(*comp));
+ comp = (waypoint **) xcalloc(wc, sizeof(*comp));
i = 0;
}
}
- home_pos = xcalloc(sizeof(*home_pos), 1);
+ home_pos = (waypoint *) xcalloc(sizeof(*home_pos), 1);
if (latopt)
home_pos->latitude = atof(latopt);
{
if ( !cur_rte ) return;
xte_recs[xte_count].ordinal=xte_count;
- xte_recs[xte_count].intermed = xmalloc( sizeof(struct xte_intermed));
+ xte_recs[xte_count].intermed = (xte_intermed *) xmalloc( sizeof(struct xte_intermed));
xte_recs[xte_count].intermed->wpt = wpt;
xte_recs[xte_count].intermed->xte_rec = xte_recs+xte_count;
xte_recs[xte_count].intermed->next = NULL;
/* short-circuit if we already have fewer than the max points */
if ( count >= rte->rte_waypt_ct) return;
- xte_recs = xcalloc( rte->rte_waypt_ct, sizeof (struct xte));
+ xte_recs = (xte *) xcalloc( rte->rte_waypt_ct, sizeof (struct xte));
cur_rte = rte;
}
wc = waypt_count();
- comp = xcalloc(wc, sizeof(*comp));
+ comp = (waypoint **) xcalloc(wc, sizeof(*comp));
QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
comp[i] = (waypoint *)elem;
/* field delimiters are always bad characters */
if (xcsv_file.badchars) {
- xcsv_file.badchars = xrealloc(xcsv_file.badchars,
+ xcsv_file.badchars = (char *) xrealloc(xcsv_file.badchars,
strlen(xcsv_file.badchars) +
strlen(p) + 1);
} else {
- xcsv_file.badchars = xcalloc(strlen(p) + 1, 1);
+ xcsv_file.badchars = (char *) xcalloc(strlen(p) + 1, 1);
}
strcat(xcsv_file.badchars, p);
/* record delimiters are always bad characters */
if (xcsv_file.badchars) {
- xcsv_file.badchars = xrealloc(xcsv_file.badchars,
+ xcsv_file.badchars = (char *) xrealloc(xcsv_file.badchars,
strlen(xcsv_file.badchars) +
strlen(p) + 1);
} else {
- xcsv_file.badchars = xcalloc(strlen(p) + 1, 1);
+ xcsv_file.badchars = (char *) xcalloc(strlen(p) + 1, 1);
}
strcat(xcsv_file.badchars, p);
p = sp;
if (xcsv_file.badchars) {
- xcsv_file.badchars = xrealloc(xcsv_file.badchars,
+ xcsv_file.badchars = (char *) xrealloc(xcsv_file.badchars,
strlen(xcsv_file.badchars) +
strlen(p) + 1);
} else {
- xcsv_file.badchars = xcalloc(strlen(p) + 1, 1);
+ xcsv_file.badchars = (char *) xcalloc(strlen(p) + 1, 1);
}
strcat(xcsv_file.badchars, p);